/*
 *  Copyright 2023 Collate.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *  http://www.apache.org/licenses/LICENSE-2.0
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

@import (reference) '../../../styles/variables.less';

@border_color_1: #ffffff;
@border_right_color_1: transparent;
@border_left_color_2: #51c41a;

@keyframes rotate {
  from {
    transform: rotate(0);
  }
  to {
    transform: rotate(360deg);
  }
}

.loader {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 5px solid rgba(0, 0, 0, 0.1);
  border-left-color: @primary-color;
  background: transparent;
  animation: rotate 1s linear infinite;
  margin: 6rem auto;

  &.loader-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
    margin: auto;
  }

  &.loader-x-sm {
    width: 14px;
    height: 14px;
    border-width: 1.5px;
    margin: auto;
  }

  &.loader-success {
    border-left-color: @border_left_color_2;
  }
  &.loader-error {
    border-left-color: @error-color;
  }
  &.loader-white {
    border-color: @border_color_1;
    border-right-color: @border_right_color_1;
  }
}
.aspect-square {
  aspect-ratio: 1;
}
